/*
 * Created on Sep 23, 2003
 * Alert
 * Local Projects Database
 * (comparator) 2003 eRomania Gateway Association
 *
 */
package ro.gateway.aida.usr.messaging;

import java.sql.Date;
import java.util.HashMap;
import java.util.Map;



/**
 * @author Mihai Postelnicu
 * Alert
 *
 *  *
 */
public class Alert extends Event
{
      protected int priority;
      protected boolean byEmail;
      protected int alertType;
      protected boolean deleted; //if it is in trashbox
      protected Date read; //the date the notifiction was read,null if unread
      protected long to; //this is the destination user id
      protected Map params;

      public Alert( Event l )
      {
            setSourceUserId( l.getSourceUserId() );
            setEventId( l.getEventId() );
            setSourceObjId( l.getSourceObjId() );
            setSent( l.getSent() );
            setSourceType( l.getSourceType() );
            setEventType( l.getEventType() );
            setSourceUserName( l.getSourceUserName() );
            params = new HashMap();
            read = null;
      }

      public Alert()
      {
            params = new HashMap();

      }

      /**
       * @return
       */
      public int getAlertType()
      {
            return alertType;
      }

      /**
       * @return
       */
      public int getPriority()
      {
            return priority;
      }

      /**
       * @return
       */
      public boolean isByEmail()
      {
            return byEmail;
      }

      /**
       * @param i
       */
      public void setAlertType( int i )
      {
            alertType = i;
      }

      /**
       * @param i
       */
      public void setPriority( int i )
      {
            priority = i;
      }

      /**
       * @param b
       */
      public void setByEmail( boolean b )
      {
            byEmail = b;
      }

      /**
       * @return
       */
      public boolean isDeleted()
      {
            return deleted;
      }

      /**
       * @return
       */
      public Date getRead()
      {
            return read;
      }

      /**
       * @param b
       */
      public void setDeleted( boolean b )
      {
            deleted = b;
      }

      /**
       * @param date
       */
      public void setRead( Date date )
      {
            read = date;
      }

      /**
       * @return
       */
      public long getTo()
      {
            return to;
      }

      /**
       * @param i
       */
      public void setTo( long i )
      {
            to = i;
      }

      /**
       * @return
       */
      public Map getParams()
      {
            return params;
      }

      /**
       * @param map
       */
      public void setParams( Map map )
      {
            params = map;
      }

      public static final int APPROVE_ALERT = 1;
      public static final int FILTER_ALERT = 2;
      public static final int MESSAGE_ALERT = 3;

      public static final int PRIORITY_LOW = 1;
      public static final int PRIORITY_NORMAL = 2;
      public static final int PRIORITY_HIGH = 3;
}
